home *** CD-ROM | disk | FTP | other *** search
/ Disc to the Future 2 / Disc to the Future Part II Programmer's Reference (Wayzata Technology)(6013)(1992).bin / MAC / THINKC / 4_0 / LISTMANA / __TESTER / TESTER.H < prev    next >
Text File  |  1989-06-24  |  3KB  |  118 lines

  1. #define    MAX_WINDOWS        20
  2.  
  3. /****/
  4. /**** Window information */
  5. /****/
  6.  
  7. typedef struct
  8. {
  9.     WindowPtr    window;                            /* Window */
  10.     Ptr            wStorage;                        /* Window Storage */
  11.     Handle        data;                            /* Window data */
  12.     int            handler;                        /* Handler */
  13.     int            idle;                            /* Send an idle signal? */
  14. } WindowInfo;
  15.  
  16. /****/
  17. /**** Handler definitions */
  18. /****/
  19.  
  20. typedef struct
  21. {
  22.     int            preLaunch;                        /* Launch at start of test */
  23.     int            idle;                            /* Idle */
  24.     char        *menuName;                        /* Menu Name */
  25.     void        (*base)();                        /* Base address of handler */
  26. } Handler;
  27.  
  28. /****/
  29. /**** Messages to handlers */
  30. /****/
  31.  
  32. #define    MESS_UPDATE        1
  33. #define    MESS_HIT        2
  34. #define    MESS_NEW        3
  35. #define    MESS_CLOSE        4
  36. #define    MESS_IDLE        5
  37. #define    MESS_GROW        6
  38. #define    MESS_ACTIVATE    7
  39. #define    MESS_DEACTIVATE    8
  40. #define    MESS_KEY        9
  41.  
  42. /****/
  43. /**** Boot times for handlers */
  44. /****/
  45.  
  46. #define    BOOT_FIRST        1
  47. #define    BOOT_MENU        2
  48.  
  49. /****/
  50. /**** Handler routines */
  51. /****/
  52.  
  53. void NormalListHandler(int mess,unsigned char *data);
  54. void FileListHandler(int mess,unsigned char *data);
  55. void TextEditListHandler(int mess,unsigned char *data);
  56.  
  57. /****/
  58. /**** Setup the handlers */
  59. /****/
  60.  
  61. #ifdef MAIN
  62.   Handler Handlers[]=
  63.   {
  64.       {BOOT_FIRST ,0 ,"Normal List"   ,NormalListHandler},
  65.       {BOOT_FIRST ,0 ,"File List"     ,FileListHandler},
  66.       {BOOT_FIRST ,0 ,"TextEdit List" ,TextEditListHandler},
  67.       {-1}
  68.   };
  69. #else
  70.   extern Handler Handlers[];
  71. #endif
  72.  
  73. /****/
  74. /**** Externals */
  75. /****/
  76.  
  77. #ifdef MAIN
  78.   MenuHandle                            Menus[20];
  79.   int                                    bootHandler;
  80.   WindowInfo                            Windows[20];
  81.   int                                    CurHandler;
  82.   int                                    CurWindow;
  83.   Rect                                    dragRect;
  84.   PicHandle                                growBoxHandle;
  85. #else
  86.   extern MenuHandle                        Menus[20];
  87.   extern int                            bootHandler;
  88.   extern WindowInfo                        Windows[20];
  89.   extern int                            CurHandler;
  90.   extern int                            CurWindow;
  91.   extern Rect                            dragRect;
  92.   extern PicHandle                        growBoxHandle;
  93. #endif
  94.  
  95. int TesterDialogNew(int resID,int handler);
  96. int TesterFindProgWindow(WindowPtr window);
  97. void TesterAllocateWindowData(long size);
  98. void TesterLockWindowInfo();
  99. void TesterLockWindowInfoWindow(WindowPtr window);
  100. void TesterUnLockWindowInfoWindow(WindowPtr window);
  101. void TesterLockWindowInfoNum(int win);
  102. void TesterUnLockWindowInfo();
  103. void TesterUnLockWindowInfoNum(int win);
  104. unsigned char *TesterGetWindowInfo();
  105. unsigned char *TesterGetWindowInfoIndirect(WindowPtr window);
  106. void TesterKillWindow(int win);
  107. int TesterOnlyOneHandler(int handler);
  108.  
  109. void TesterOpenHandler(int hand);
  110. void TesterUpdate(int win);
  111. void TesterHitInWindow(WindowPtr window,int hit);
  112. void TesterSendIdle(int win);
  113. void TesterCloseWindow(int win);
  114. void TesterSendGrow(int win);
  115. void TesterActivate(WindowPtr window);
  116. void TesterKey(int win,unsigned char ch);
  117.  
  118. void DrawFakeGrow(WindowPtr Window);